package com.huawei.appgallery.forum.posts.card;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams;
import com.huawei.appgallery.forum.posts.buoy.action.OpenMoreProductAction;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.plugin.gameservice.view.TransferActivity;
import o.bzd.b;
import o.cdb;
import o.faj;

public class BuoyForumProcuctCard extends ForumProcuctCard {
    private ConstraintLayout ᐝ;

    public BuoyForumProcuctCard(Context context) {
        super(context);
        ˊ(true);
    }

    public void ˏ(final CardBean cardBean) {
        super.ˏ(cardBean);
        ˎ();
        OnClickListener anonymousClass3 = new OnClickListener(this) {
            final /* synthetic */ BuoyForumProcuctCard ˏ;

            public void onClick(View view) {
                if (cardBean instanceof BaseCardBean) {
                    BaseCardBean baseCardBean = (BaseCardBean) cardBean;
                    Intent intent = new Intent(this.ˏ.ˉ().getContext(), TransferActivity.class);
                    intent.setAction(OpenMoreProductAction.ACTION_OPEN_MORE_PRODUCT);
                    intent.putExtra("detailId", baseCardBean.ॱॱ());
                    intent.putExtra("trace", baseCardBean.u_());
                    ((faj) cdb.ॱ(faj.class)).ˊ(this.ˏ.ˉ().getContext(), TransferActivity.class, intent);
                }
            }
        };
        ˉ().setOnClickListener(anonymousClass3);
        this.ˊ.setOnClickListener(anonymousClass3);
    }

    private void ˎ() {
        if (!ˊ() && this.ˏ.getVisibility() == 8 && this.ॱ.getVisibility() == 8) {
            this.ᐝ = (ConstraintLayout) ˉ().findViewById(b.ͺॱ);
            LayoutParams layoutParams = (LayoutParams) this.ᐝ.getLayoutParams();
            layoutParams.ˊॱ = -1;
            this.ᐝ.setLayoutParams(layoutParams);
            layoutParams = (LayoutParams) this.ˎ.getLayoutParams();
            layoutParams.ॱˋ = -1;
            layoutParams.ॱᐝ = b.ॱʻ;
            this.ˎ.setLayoutParams(layoutParams);
        }
    }
}
